<template>
    <div class="sh-tab-pane" v-show="active">
      <slot></slot>
    </div>
</template>

<script>
export default {
  name: 'TabPane',
  props: {
    icon: String,
    label: String,
    name: [String, Number],
    disabled: {
      type: Boolean,
      default: false
    },
    closed: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      active: false
    }
  },
  mounted () {
    // 增加的时候与父容器宽度比对，动态设置横向滚动距离
    this.$parent.changeChildState()
  },
  destroyed () {
    this.$parent.changeChildState()
  }
}
</script>
